from db import BaseModel
from sqlalchemy import Column, Integer, String, DateTime


class Customer(BaseModel):
    __tablename__ = "customer"
    __table_args__ = ({'comment': '客户管理'})

    GRADE_CHOICES = {
        "A": "重要客户",
        "B": "优质客户",
        "C": "普通客户"
    }

    PLATFORM_CHOICES = {
        1: "淘宝专卖店",
        2: "京东专卖店",
        3: "拼多多专卖店"
    }

    name = Column(String(20), index=True, nullable=False, comment="客户名")
    nickname = Column(String(20), nullable=True, comment="称呼")

    telephone = Column(String(11), nullable=True, comment="手机号")
    wechat = Column(String(50), nullable=True, comment="微信")
    qq = Column(String(50), nullable=True, comment="QQ")
    address_code = Column(String(255), nullable=True, comment="地址编码")

    grade = Column(String(50), default="C", nullable=False, comment="等级")
    platform = Column(Integer, default=1, nullable=False, comment="平台")
